package org.thss.petri.gef.ui;

import org.eclipse.gef.ui.actions.ActionBarContributor;
import org.eclipse.gef.ui.actions.DeleteRetargetAction;
import org.eclipse.gef.ui.actions.RedoRetargetAction;
import org.eclipse.gef.ui.actions.UndoRetargetAction;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.actions.ActionFactory;
import org.thss.petri.gef.actions.FirePetriNetRetargetAction;
import org.thss.petri.gef.actions.FireTransitionRetargetAction;

public class PetriNetEditorActionBarContributor extends ActionBarContributor {

	private IEditorPart editor;
	
	@Override
	public void setActiveEditor(IEditorPart editor) {
		// TODO Auto-generated method stub
		super.setActiveEditor(editor);
		this.editor = editor;
	}

	@Override
	public void contributeToToolBar(IToolBarManager toolBarManager) {
		// TODO Auto-generated method stub
		toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
		toolBarManager.add(getAction(ActionFactory.REDO.getId()));
		toolBarManager.add(getAction(ActionFactory.DELETE.getId()));
		toolBarManager.add(new Separator());
		toolBarManager.add(getAction("fire_transition_action"));
		toolBarManager.add(getAction("fire_petrinet_action"));
		
	}

	@Override
	protected void buildActions() {
		
		// TODO Auto-generated method stub
		addRetargetAction(new UndoRetargetAction());
		addRetargetAction(new RedoRetargetAction());
		addRetargetAction(new DeleteRetargetAction());
		addRetargetAction(new FireTransitionRetargetAction());
		addRetargetAction(new FirePetriNetRetargetAction());
	}

	@Override
	protected void declareGlobalActionKeys() {
		// TODO Auto-generated method stub
		
	}
	
	

}
